package com.thenmorethings.service.impl;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.thenmorethings.dao.EssayDao;
import com.thenmorethings.entity.Essay;
import com.thenmorethings.service.EssayService;

@Service("essayService")
public class EssayServiceImpl implements EssayService{

	@Resource
	private EssayDao essayDao;
	
	@Override
	public List<Essay> findAll() {
		return essayDao.findObjects();
	}

	@Override
	public void EssayAdd(Essay essay) {
		essayDao.save(essay);
	}

	@Override
	public void EssayDelete(Serializable id) {
		essayDao.deleteById(id);
	}

	@Override
	public Essay EssayFind(Serializable id) {
		Essay essay = essayDao.findObjectById(id);
		return essay;
		
	}

	@Override
	public void EssayUpdate(Essay essay) {
		essayDao.update(essay);
		
	}

	@Override
	public List<Essay> EssayPagination(Integer start, Integer endrow) {
		return essayDao.rowPagination(start, endrow);
	}

}
